
function showConfirm(title, text, yes, no) {
	if(!$.flashcardConfirm)
		createConfirmDialog();
	
	$.flashcardConfirm.enableNo();
	$.flashcardConfirm.setTitle(title);
	$.flashcardConfirm.setText(text);
	$.flashcardConfirm.setYesCallback(yes ? yes : function() {});
	$.flashcardConfirm.setNoCallback(no ? no : function() {});
	$.flashcardConfirm.display();
}
/**
 * 
 * @param title
 * @param text
 * @param opt { yes: callback, btnYes: title }
 */
function showNotice(title, text, opt) {
	if(!$.flashcardConfirm)
		createConfirmDialog();
	
	$.flashcardConfirm.disableNo();
	$.flashcardConfirm.setTitle(title);
	$.flashcardConfirm.setText(text);
	$.flashcardConfirm.setYesCallback((opt && opt.yes) ? opt.yes : function() {});
	$.flashcardConfirm.yesTitle((opt && opt.btnYes) ? opt.btnYes: 'Đồng ý');
	$.flashcardConfirm.display();
}
$.showNotice = showNotice;
function createConfirmDialog() {
	var content = "<div id='confirm_fancybox' style='display:none;width:450px;'><div id='confirm_title' style=''></div>" +
					"<div id='confirm_text' style='font-size:14px;text-align:center;margin:20px 0;'></div>" +
					'<div class="clear"></div>' +
					'<p class="" align="center"><a href="javascript:;" id="btnConfirmYes" onclick="$.flashcardConfirm.yes()" class="bnt_large">Đồng ý</a> <a href="javascript:;" id="btnConfirmNo" onclick="$.flashcardConfirm.no()" class="bnt_large">Hủy bỏ</a></p></div>' +
					'<a href="#confirm_fancybox" id="confirm_link" style="display:none">Show confirm</a>';
	$(content).appendTo("body");
	$('#confirm_link').fancybox({
        padding:20,
        scrolling: 'no',
        fitToView   : false
    });
	
	$.flashcardConfirm = {
		yesCallback: function() {},
		noCallback: function() {},
		display: function() {
			$("#confirm_link").trigger('click');
		},
		setTitle: function(title) {
			$("#confirm_title").text(title);
		},
		setText: function(text) {
			$("#confirm_text").text(text);
		},
		setYesCallback: function(yes) {
			this.yesCallback = yes;
		},
		setNoCallback: function(no) {
			this.noCallback = no;
		},
		yes: function() {
			this.yesCallback();
			$.fancybox.close();
		},
		yesTitle: function(text) {
			$('#btnConfirmYes').text(text);
		},
		no: function() {
			this.noCallback();
			$.fancybox.close();
		},
		enableNo: function() {
			$("#btnConfirmNo").show();
		},
		disableNo: function() {
			$("#btnConfirmNo").hide();
		}
	};
}
function fc_mouseover(sender, cl) {
	$(sender).addClass(cl);
}
function fc_mouseout(sender, cl) {
	if(!$(sender).is(".active"))
		$(sender).removeClass(cl);
}
function fc_activemenu(itemorder) {
	$("#menu li:eq("+itemorder+")").addClass("item_"+(itemorder + 1)+"_active active");
}

function fc_activemenunotlogin(itemorder){
	clas = $("#menu li:eq("+itemorder+")").attr('class');
	$("#menu li:eq("+itemorder+")").addClass(clas +"_active active");
}